package com.yonyou.cyxdms.sysAuth.service.dto;

import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;


/**
 * <p>
 * 组织
 * </p>
 *
 * @author 李贺
 * @since 2019-09-18
 */

public class OrgDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 组织ID
     */
        private Long orgId;
        /**
     * 本身所在company_id
     */
        private Long companyId;
            private String orgCode;
        /**
     * 组织名称
     */
        private String orgName;
        /**
     * 组织名称缩写
     */
        private String orgShortName;
        /**
     * 组织描述
     */
        private String orgDesc;
        /**
     * 组织类型ID:1680 ;公司、部门、大区、小区、经销商、服务站
     */
        private Integer orgType;
        /**
     * 有效，无效
     */
        private Integer isValid;
        /**
     * 数据参考模板ID(主要用于经销商集团创建的部门模板)
     */
        private Integer dataTemplateId;
        /**
     * 数据来源
     */
        private Integer dataSource;
        /**
     * 数据类型（用于区分是经销商还是集团）
     */
        private Integer dataType;
        /**
     * 来源日期
     */
        @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime sourceChangedAt;
            private Integer isDeleted;
    
    public OrgDTO() {
        super();
    }




    public Long getOrgId() {
        return orgId;
    }


    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }



    public Long getCompanyId() {
        return companyId;
    }


    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }



    public String getOrgCode() {
        return orgCode;
    }


    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }



    public String getOrgName() {
        return orgName;
    }


    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }



    public String getOrgShortName() {
        return orgShortName;
    }


    public void setOrgShortName(String orgShortName) {
        this.orgShortName = orgShortName;
    }



    public String getOrgDesc() {
        return orgDesc;
    }


    public void setOrgDesc(String orgDesc) {
        this.orgDesc = orgDesc;
    }



    public Integer getOrgType() {
        return orgType;
    }


    public void setOrgType(Integer orgType) {
        this.orgType = orgType;
    }



    public Integer getIsValid() {
        return isValid;
    }


    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }



    public Integer getDataTemplateId() {
        return dataTemplateId;
    }


    public void setDataTemplateId(Integer dataTemplateId) {
        this.dataTemplateId = dataTemplateId;
    }



    public Integer getDataSource() {
        return dataSource;
    }


    public void setDataSource(Integer dataSource) {
        this.dataSource = dataSource;
    }



    public Integer getDataType() {
        return dataType;
    }


    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }



    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }


    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }



    public Integer getIsDeleted() {
        return isDeleted;
    }


    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }



    @Override
    public String toString() {
        return "OrgDTO{" +
        "orgId=" + orgId +
        ", companyId=" + companyId +
        ", orgCode=" + orgCode +
        ", orgName=" + orgName +
        ", orgShortName=" + orgShortName +
        ", orgDesc=" + orgDesc +
        ", orgType=" + orgType +
        ", isValid=" + isValid +
        ", dataTemplateId=" + dataTemplateId +
        ", dataSource=" + dataSource +
        ", dataType=" + dataType +
        ", sourceChangedAt=" + sourceChangedAt +
        ", isDeleted=" + isDeleted +
        "}";
    }
    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     * @param poClass dto 需要转换的dto
     * @author 李贺
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     * @param po 需要转换的对象
     * @author 李贺
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "orgId");
    }

}
